package easy;

public class Solution_392 {

    public static boolean isSubsequence(String s, String t) {
        if (s.length()==0) return true;
        char[] chars = t.toCharArray();
        char[] target = s.toCharArray();
        for (int i = 0, index = 0; i < chars.length; i++) {
            if (chars[i]==target[index]) {
                index++;
            }
            if (index==target.length) {
                return true;
            }
        }
        return false;
    }

    public static void main(String[] args) {
//        System.out.println(1^3^2^7^6^5^8^8^9);
//        System.out.println(1^3^2^7^6^5^8^8^9);
        System.out.println(isSubsequence("abc", "ahbgdc"));
        System.out.println(isSubsequence("axc", "ahbgdc"));
//        System.out.println(firstUniqChar("loveleetcode"));
    }
}
